package state;

import java.util.Hashtable;

public class LoadResourceCompleteListener {
  private String resourceName;
  private Hashtable data = new Hashtable();
  
  public LoadResourceCompleteListener(String resourceName) {
    this.resourceName = resourceName;
  }

  public String getResourceName() {
    return resourceName;
  }
  
  public LoadResourceCompleteListener put(String name, int value) {
    data.put(name, new Integer(value));
    return this;
  }
  
  public LoadResourceCompleteListener put(String name, double value) {
    data.put(name, new Double(value));
    return this;
  }
  
  public LoadResourceCompleteListener put(String name, Object value) {
    data.put(name, value);
    return this;
  }
  
  public Object get(String name) {
    return data.get(name);
  }
  
  public String getString(String name) {
    return String.valueOf(data.get(name));
  }
  
  public int getInt(String name) {
    return ((Integer) data.get(name)).intValue();
  }
  
  public double getDouble(String name) {
    return ((Double) data.get(name)).doubleValue();
  }
  
  public void onLoadResourceDone(Image image) {
  }
}
